// components/recharge-card-item/recharge-card-item.js
let app = getApp();
const STYLE_TEXT = {
  0: '全部',
  1: '充值',
  2: '扣款',
  3: '提现',
  4: '下单抵扣',
  5: '订单退款',
  6: '消费佣金',
  7: '平推佣金',
  8: '提现退回',
  // 9: '购买VIP',
  9: '供应商货款结算',
  10: '购买VIP推荐奖励',
  11: '单品退款',
  12: '用户购买VIP'
}
Component({

  options: {
    addGlobalClass: true,//使用app.wxss样式
    styleIsolation: 'shared'
  },
  /**
   * 组件的属性列表
   */
  properties: {
    item: {
      type: Object,
      observer(newVal,oldVal,changedPath){
      }
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    STYLE_TEXT,
    lookList: [],
    isShow: false,
  },

  /**
   * 组件的方法列表
   */
  methods: {
    lookWater(event){
      let _this = this;
      let user = app.getUser();
      let cardId = event.currentTarget.dataset.cardid;
      app.requestUrl({
        method: 'GET',
        url: '/wxapi/balance/list',
        data: {
          mid: user.id,
          style: '',
          shipcardRecordId: cardId,
          offset: 0,
          limit: 400,
        }
      }).then(res =>{
        _this.setData({ lookList: res.data.data.rows })
        _this.showMonitor();
      })
    },
    showMonitor(){
      let _this = this;
      _this.setData({ isShow: !_this.data.isShow})
    },
  }
})
